/*********************************************************
 * Cameron Hilton
 * CS362_400
 * 
 * Test to see if card value returned properly in getCost() function
 ********************************************************/

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

int main() {
    
    int seed = 1000;
    int numPlayer = 2;
    int i;
    
	struct gameState state;
	int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse, sea_hag, tribute, smithy};

	initializeGame(numPlayer, k, seed, &state);
	
	printf("Testing curse cost\n");
	assert(getCost(curse) == 0);
	printf("Testing estate cost\n");
	assert(getCost(estate) == 2);
	printf("Testing duchy cost\n");
	assert(getCost(duchy) == 5);
	printf("Testing province cost\n");
	assert(getCost(province) == 8);
	printf("Testing copper cost\n");
	assert(getCost(copper) == 0);
	printf("Testing silver cost\n");
	assert(getCost(silver) == 3);
	printf("Testing gold cost\n");
	assert(getCost(gold) == 6);
	printf("Testing adventurer cost\n");
	assert(getCost(adventurer) == 6);
	printf("Testing council_room cost\n");
	assert(getCost(council_room) == 5);
	printf("Testing feast cost\n");
	assert(getCost(feast) == 4);
	printf("Testing gardens cost\n");
	assert(getCost(gardens) == 4);
	printf("Testing mine cost\n");
	assert(getCost(mine) == 5);
	printf("Testing remodel cost\n");
	assert(getCost(remodel) == 4);
	printf("Testing smithy cost\n");
	assert(getCost(smithy) == 4);
	printf("Testing village cost\n");
	assert(getCost(village) == 3);
	printf("Testing baron cost\n");
	assert(getCost(baron) == 4);
	printf("Testing great_hall cost\n");
	assert(getCost(great_hall) == 3);
	printf("Testing minion cost\n");
	assert(getCost(minion) == 5);
	printf("Testing steward cost\n");
	assert(getCost(steward) == 3);
	printf("Testing tribute cost\n");
	assert(getCost(tribute) == 5);
	printf("Testing ambassador cost\n");
	assert(getCost(ambassador) == 3);
	printf("Testing cutpurse cost\n");
	assert(getCost(cutpurse) == 4);
	printf("Testing embargo cost\n");
	assert(getCost(embargo) == 2);
	printf("Testing outpost cost\n");
	assert(getCost(outpost) == 5);
	printf("Testing salvager cost\n");
	assert(getCost(salvager) == 4);
	printf("Testing sea_hag cost\n");
	assert(getCost(sea_hag) == 4);
	printf("Testing treasure_map cost\n");
	assert(getCost(treasure_map) == 4);

	// test unexpected values
	printf("Testing unexpected input values\n");
	for (i = -1; i >= -1000000; i--) {
		assert(getCost(i) == -1);
	}
	for (i = treasure_map + 1; i <= 1000000; i++) {
		assert(getCost(i) == -1);
	}

    printf("All tests passed!\n");

    return 0;
}